package com.situ.day2;

import org.junit.Test;

public class ContinueBreakDemo {
	
	@Test
	public void test1() {
		for (int i = 1; i <= 5; i++) {
			if (i == 3) {
				continue;
			}
			System.out.println(i);
		}
	}
	
	@Test
	public void test2() {
		for (int i = 1; i <= 5; i++) {
			if (i == 3) {
				break;
			}
			System.out.println(i);
		}
	}
	
	@Test
	public void test3() {
		for (int i = 1; i <= 5; i++) {
			for (int j = 1; j <= 5; j++) {
				if (j == 3) {
					break;//只能调出离他最近的那一层循环
				}
				System.out.println(j);
			}
		}
	}
}
